OpenWGA 7.9 - WebTML reference

WebTML tags » [All condition tags]

<tml:[All condition tags] iscontextvalid ="true | false | t | f | 0 | 1">

Purpose:

Tests if the context change done on attribute context succeeded

Description:

This attributes gives the WebTML code a chance to react on a failed context change on the current tag, or execute a special operation only when it succeeded.

Additionally it is the only case in WebTML where a WebTML tag may perform normal execution when its context change failed (which normally leads to the cancellation of the tag). You could use iscontextvalid="false" on a <tml:case> tag which would let the contents of the tag be executed only when the context change fails. Or you could use iscontextvalid="true" on a <tml:if>, which in case of a context change failure would given an optional <tml:elseif> or <tml:else> tag the opportunity to be executed.

Examples:

An example attempting a context change to a document of unique name "home". If the change succeeds we will output some data from this document (which is straightforward as we are now in its context). If it fails we put out an error message.

<tml:if context="name:home" iscontextvalid="true">
  <tml:then>
    On document of title <tml:meta name="title"/>
  </tml:then>
  <tml:else>
    There is no document of name home!
  </tml:else>
</tml:if>